#ifndef __DATA_MANAGER_H
#define __DATA_MANAGER_H

#include "sys.h"

typedef struct SenseDataStruct{
	uint8_t *Addr;
	uint16_t UpThr;
	uint16_t DownThr;
	struct SenseDataStruct *ptNext;
}T_SenseDataStruct, *PT_SenseDataStruct;

typedef struct ROMDataStruct{
	uint8_t Num;
	uint16_t SendTime;
	PT_SenseDataStruct SenseDataHead;
}T_ROMDataStruct, *PT_ROMDataStruct;

typedef struct SaveOpr{
	char *name;
	int (*SaveData)(PT_ROMDataStruct ptROMData);
	int (*GetData)(PT_ROMDataStruct ptROMData);
	void (*FreeMalloc)(void);
	struct SaveOpr *ptNext;
}T_SaveOpr,*PT_SaveOpr;


void ROM_GetData(uint16_t paddr,uint8_t *pBuffer,uint8_t len);
uint8_t ROM_ChangeData(uint16_t paddr,uint8_t *pBuffer,uint8_t len);
int RegisterSaveOpr(PT_SaveOpr ptSaveOpr);
PT_SaveOpr GetSaveOpr(char *pcName);
void ShowSaveOpr(void);
int SaveInit(void);

int DS18B20DataInit(void);
int VibratorDataInit(void);
int MachineDataInit(void);
int InfrDataInit(void);
int CurrentDataInit(void);

#endif
